package br.edu.ufcg.lsd.wbis.ui.client.ui.loggedin.admin;

import br.edu.ufcg.lsd.wbis.ui.client.beans.UserInfo;
import br.edu.ufcg.lsd.wbis.ui.client.ui.loggedin.admin.home.registered.UserInfoViewerToolbar;
import br.edu.ufcg.lsd.wbis.ui.client.ui.management.InfoManager;

import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.TabPanel;
import com.gwtext.client.widgets.layout.ColumnLayout;

public class UserInfoViewerPanel extends Panel {

	private final UserInfoPanel infoPanel;

	private final UserInfoViewerToolbar viewerToolbar;

	public UserInfoViewerPanel(TabPanel centerPanel, InfoManager<UserInfo> loggedManager) {

		this.infoPanel = new UserInfoPanel();
		this.viewerToolbar = new UserInfoViewerToolbar(centerPanel, loggedManager);

		this.setLayout(new ColumnLayout());

		this.add(this.infoPanel);
		this.add(this.viewerToolbar);
	}

	public void updateInfo(UserInfo info) {
		this.infoPanel.updateInfo(info);
		this.viewerToolbar.updateInfo(info);
	}

}